/**
 * 布局参考的案例路由
 * Created by MR.k on 2021/7/1.
 */
import Layout from '@/views/layout'

const exampleRouter = {
  path: '/example',
  name: 'Example',
  redirect: 'noRedirect',
  meta: {
    title: '布局参考',
    icon: 'awesome-icon fab fa-artstation',
    roles: ['admin']
  },
  component: Layout,
  alwaysShow: true,
  children: [{
    path: 'complex-table',
    component: () => import('@/views/example/table/complex-table'),
    name: 'ComplexTable',
    meta: {
      title: '普通列表',
      icon: 'table',
      roles: ['admin']
    }
  },
  {
    path: 'tree-table',
    component: () => import('@/views/example/table/tree-table'),
    name: 'TreeTable',
    meta: {
      title: '树形列表',
      icon: 'tree',
      roles: ['admin']
    }
  },
  {
    path: 'form',
    name: 'FormCreate',
    component: () => import('@/views/example/form/edit'),
    meta: {
      title: '表单',
      icon: 'form',
      roles: ['admin']
    }
  },
  {
    path: ':id/form',
    name: 'FormEdit',
    component: () => import('@/views/example/form/edit'),
    meta: {
      title: '表单',
      icon: 'form',
      roles: ['admin']
    },
    hidden: true
  },
  {
    path: 'icon',
    component: () => import('@/views/example/icons/index'),
    name: 'Icons',
    meta: {
      title: '图标',
      icon: 'awesome-icon fab fa-fonticons example-icons',
      noCache: true,
      roles: ['admin']
    }
  },
  {
    path: 'nested',
    name: 'Nested',
    meta: {
      title: '路由嵌套',
      icon: 'nested',
      roles: ['admin']
    },
    component: () => import('@/views/example/nested/index'),
    children: [{
      path: 'menu1',
      component: () => import('@/views/example/nested/menu1/index'),
      name: 'Menu1',
      meta: {
        title: '菜单1',
        roles: ['admin']
      },
      children: [{
        path: 'menu1-1',
        component: () => import('@/views/example/nested/menu1/menu1-1'),
        name: 'Menu1-1',
        meta: {
          title: '菜单 1-1',
          roles: ['admin']
        }
      },
      {
        path: 'menu1-2',
        component: () => import('@/views/example/nested/menu1/menu1-2'),
        name: 'Menu1-2',
        meta: {
          title: '菜单 1-2',
          roles: ['admin']
        },
        children: [{
          path: 'menu1-2-1',
          component: () => import('@/views/example/nested/menu1/menu1-2/menu1-2-1'),
          name: 'Menu1-2-1',
          meta: {
            title: '菜单 1-2-1',
            roles: ['admin']
          }
        },
        {
          path: 'menu1-2-2',
          component: () => import('@/views/example/nested/menu1/menu1-2/menu1-2-2'),
          name: 'Menu1-2-2',
          meta: {
            title: '菜单 1-2-2',
            roles: ['admin']
          }
        }
        ]
      },
      {
        path: 'menu1-3',
        component: () => import('@/views/example/nested/menu1/menu1-3'),
        name: 'Menu1-3',
        meta: {
          title: '菜单 1-3',
          roles: ['admin']
        }
      }
      ]
    },
    {
      path: 'menu2',
      component: () => import('@/views/example/nested/menu2/index'),
      name: 'Menu2',
      meta: {
        title: '菜单 2',
        roles: ['admin']
      }
    }
    ]
  }
  ]
}

export default exampleRouter
